<!DOCTYPE HTML>
<html>

<head>
  <title></title>
  <meta charset="utf-8">
  <meta name="renderer" content="webkit|ie-comp|ie-stand">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <link rel="Bookmark" href="/favicon.ico">
  <link rel="Shortcut Icon" href="/favicon.ico" />
  <link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/static/h-ui/css/H-ui.min.css" />
  <link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/static/h-ui.admin/css/H-ui.admin.css" />
  <link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/lib/Hui-iconfont/1.0.8/iconfont.css" />
  <link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/static/h-ui.admin/skin/default/skin.css" id="skin" />
  <link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/static/h-ui.admin/css/style.css" />
  <!-- <script src="../ckeditor/ckeditor/ckeditor.js"></script> -->
  <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/base.css">
  <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/contract_sealManage-set.css">
  <title>印章管理</title>
  <style>

    /*.oldImd{*/
      /*background: url("__PUBLIC__/tmpImg/jiequ99.jpg")no-repeat;*/
    /*}*/
  </style>

</head>

<body>

  <div class="page-container contract_sealManage-set">
    <form class="form form-horizontal" id="form-article-add2" method="post" enctype="multipart/form-data" action=" "  onsubmit="">

    <div class="tit col-md-9">
      <div class="left_cont">
        <span>新增印章</span>
      </div>
      <!--<div class="right_cont">-->
        <!--<input type="text" name="" placeholder="模糊搜索" style="width:150px" class="input-text">-->
        <!--<button name="" class="btn btn-success" type="submit">-->
                  <!--<i class="Hui-iconfont"></i> 搜索</button>-->
      <!--</div>-->
    </div>
    <div class="contrant_manage_table">
      <div class="row cl col-md-9 mt-20 inp_box" style="margin-right:0">
        <div class="tit_box">
          <span>输入色域：</span>
        </div>
        <div class="cont_box">
          <input class="input-text radius size-M" name="filterNum" id="filterNum" style="width:150px">
          <a onclick="show()" name="" class="btn btn-success"  >
                预览</a>
        </div>
      </div>
      <div class="row cl col-md-9 clearfix content_box">
        <div class="tit_box">
          <span class="title">印章图片:</span>
        </div>
        <div class="cont_box mt-20">
          <div class="left_cont">
            <div class="img_box">

              <img class="oldImd" id="oldImd"  src="{$jiequsrc}"    alt="">
            </div>
            <p>这是上一步选择的图片</p>
          </div>
          <div class="right_cont">
            <div class="img_box" id="newbox">

              <img  id="newImg"   alt="">
            </div>
            <p>这是处理过的图片</p>
          </div>
        </div>

      </div>
      <div class="row cl">
        <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
          <input   class="btn btn-primary radius" name="step2sub" type="submit" value="提交" onclick="save()">

        </div>
      </div>
    </div>



  <input type="hidden" name="hi" id="hi" value="">
  <input type="hidden" name="koutuimg" id="koutuimg" value="">
  <input type="hidden" name="tit" id="tit" value="{$tit}">

  </form>
  </div>

  <script type="text/javascript" src="__PUBLIC__/Admin/lib/jquery/1.9.1/jquery.min.js"></script>
  <script type="text/javascript" src="__PUBLIC__/Admin/lib/layer/2.4/layer.js"></script>
  <script type="text/javascript" src="__PUBLIC__/Admin/static/h-ui/js/H-ui.min.js"></script>
  <script type="text/javascript" src="__PUBLIC__/Admin/static/h-ui.admin/js/H-ui.admin.js"></script>


  <script type="text/javascript" src="__PUBLIC__/Admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
  <script type="text/javascript" src="__PUBLIC__/Admin/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
  <script type="text/javascript" src="__PUBLIC__/Admin/lib/jquery.validation/1.14.0/validate-methods.js"></script>
  <!--<script type="text/javascript" src="__PUBLIC__/Adminlib/jquery.validation/1.14.0/messages_zh.js"></script>-->

</body>

</html>

<script type="text/javascript">

  function show() {
     var filterNum=$('#filterNum').val();

      var r = /^\+?[1-9][0-9]*$/;　　//正整数

      if(!r.test(filterNum)||  filterNum>15 || filterNum<1   ){
          layer.msg('请输入1-15的整数', {
              icon: 5
          });
          return false;
      }


     var oldimgsrc= $("#oldImd").attr("src");
      $("#newImg").attr("src"," ")
     // alert(oldimgsrc);
      $.ajax({
          type: "post",
          url: "{:U('Admin/dofilter')}",
          data: {"filterNum":filterNum,"oldimgsrc":oldimgsrc},
          success:function (result) {
             var subres=result.substr(26);
                  // alert(subres);
         var src="http://xbb.qecity.com/"+subres;
              $("#newImg").attr("src",src)
          }
      })


  }


  function  save() {

      // alert($('#newImg').attr("src"));
      $('#koutuimg').val($('#newImg').attr("src"));




  }
</script>
